<template>
  <div class="question-create">
    <question-form v-if="qcMode === 'form'" :modified.sync="modified"></question-form>
    <question-poll v-else-if="qcMode === 'poll'" :modified.sync="modified"></question-poll>
    <question-mixed v-else :modified.sync="modified"></question-mixed>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import { checkModifyBeforeLeave } from '@/mixins'
import QuestionForm from './QuestionForm'
import QuestionPoll from './QuestionPoll'
import QuestionMixed from './QuestionMixed'

export default {
  name: 'QuestionCreate',
  components: {
    QuestionForm,
    QuestionPoll,
    QuestionMixed
  },
  mixins: [
    checkModifyBeforeLeave
  ],
  data() {
    return {
      modified: false
    }
  },
  computed: {
    ...mapGetters({
      qcMode: 'questionCreateMode'
    })
  }
}
</script>

<style scoped>

</style>
